﻿using AppService.IService.Financial_Management;
using Domain.Entity.Basic_information;
using Domain.Entity.Financial_Management;
using Domain.Entity.System_operation;
using Domain.Entity.System_Ordermanagement;
using Domain.IRepository.Financial_Management;
using Domain.IRepository.System_operation;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;

namespace AppService.Service.Financial_Management
{
    [Dependency(ServiceLifetime.Scoped)]
    public class Receivable_meterService : IReceivable_meterService
    {

        private readonly IReceivable_meterRepository rm_Repository;

        public Receivable_meterService(IReceivable_meterRepository RmRepository)
        {
            this.rm_Repository = RmRepository;
        }
        public int Count(string? Sign_time, string? value2, string? Receipt_type, string? Ord_state)
        {
            return rm_Repository.Count(Sign_time, value2, Receipt_type, Ord_state);
        }

        public List<Receivable_meter> GetReceivable_meter(int currentPage, int PageSize)
        {
            return rm_Repository.GetReceivable_meter().Skip((currentPage - 1) * PageSize).Take(PageSize).ToList();
        }

        public Orders GetOrd_id(int id)
        {
            return rm_Repository.GetOrd_id(id);
        }

        public Signature_receipt GetSign_id(int id)
        {
            return rm_Repository.GetSign_id(id);
        }

        public Customer_ment GetCustomer_id(int id)
        {
            return rm_Repository.GetCustomer_id(id);
        }

        public List<Receivable_meter> GetReceivable_meter_Update(int Receivable_Id)
        {
            return rm_Repository.GetReceivable_meter_Update(Receivable_Id);
        }

        public bool Update(Receivable_meter receivable_meter)
        {
            return rm_Repository.Update(receivable_meter)>0;
        }
    }
}
